package org.example.zpqy.controll;

import org.example.zpqy.service.AppleMaturityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.*;

@RestController
@RequestMapping("/api/maturity")
public class AppleMaturityController {

    @Autowired
    private AppleMaturityService appleMaturityService;

    @GetMapping("/info")
    public List<Map<String, Object>> getMaturityInfo(
            @RequestParam(defaultValue = "苹果") String cropName,
            @RequestParam(defaultValue = "110000") String cityCode) {
        return appleMaturityService.getMaturityInfo(cropName, cityCode);
    }
}
